package com.hzit.controller;

import com.hzit.common.entity.R;
import com.hzit.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@RestController
@RequestMapping("/user")
public class UserController {

	@Autowired
	private User user;
	@GetMapping("/getUser")
	public R getUser(){
		return R.ok().put("user",user);
	}

	//get请求
	@GetMapping
	public R findUser(){
		return R.ok().put("method","GET");
	}
	//post请求
	@PostMapping
	public R postUser(){
		return R.ok().put("method","POST");
	}
	//put请求
	@PutMapping
	public R putUser(){
		return R.ok().put("method","PUT");
	}
	//delete请求
	@DeleteMapping
	public R deleteUser(){
		return R.ok().put("method","DELETE");
	}
}
